using UnityEngine;
using System.Collections;

public class GameManager : MonoBehaviour {
	
	public static GameManager Instance;
	public ArrayList exitList{get; private set;}
	private ArrayList _keyholeList;
	private int _deathNum;
	private Rect _guiRect;
	// Use this for initialization
	void Awake () {
		Instance = this;
		_deathNum = 0;
		_guiRect = new Rect(10,10,150,50);
		exitList = new ArrayList();
		_keyholeList = new ArrayList();
		Physics.IgnoreLayerCollision(9, 9);
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	public void UpdateDeathNum()
	{
		_deathNum++;
	}

	public void RegisterExit(Exit e){
		exitList.Add(e);
	}

	public void RegisterKeyHole(KeyHole k){
		_keyholeList.Add(k);
	}

	public void LoadNextScene(){
		GlobalInfo.current_level++;
		Application.LoadLevel(GlobalInfo.levelName[GlobalInfo.current_level]);
	}

	void OnGUI()
	{
		GUI.Label(_guiRect, "#death:"+_deathNum);
	}


}
